import request from "@/utils/request";

//获取组队大厅队伍数据
export const getTeamProfileByKW = ({ current, size, isMembersShortage, notSignUp, notCutoff, projectName, kw, uid }) => {
    return request({
        url: '/teamProfile/getTeamProfileByKW',
        method: 'post',
        data: { current, size, isMembersShortage, notSignUp, notCutoff, projectName, kw, uid }
    })
}


//获取队伍详情页数据
export const getOneTeamProfile = ({ tpId }) => {
    return request({
        url: '/teamProfile/getOneTeamProfile',
        method: 'post',
        params: { tpId },
    })
}

//获取学生参与队伍的数据
export const getAllTeamMessagesByUid = () => {
    return request({
        url: '/myTeam/getAllTeamMessagesByUid',
        method: 'post'
    })
}

//修改队伍信息
export const modifyTeamMsg = (teamProfile) => {
    return request({
        url: '/teamProfile/modifyTeamMsg',
        method: 'post',
        data: teamProfile
    })
}

//解散队伍
export const dismissTeam = ({ tpId }) => {
    return request({
        url: '/teamProfile/dismissTeam',
        method: 'post',
        params: { tpId }
    })
}

//审核队伍申请
export const isPass = ({ id, flag }) => {
    return request({
        url: '/registration/isPass',
        method: 'post',
        params: { id, flag }
    })
}

//报名
export const addRegInf = (addRegInfoRequest) => {
    return request({
        url: '/registration/addRegInf',
        method: 'post',
        data: addRegInfoRequest
    })
}

//修改队员信息
export const modifyTeamInfo=(teamProfile)=>{
    return request({
        url:'/teamComposition/increTeamMember',
        method:'post',
        data:teamProfile
    })
}

//删除队员信息
export const deleTeamMember=(teamComposition)=>{
    return request({
        url:'/teamComposition/deleTeamMember',
        method:'post',
        data:teamComposition
    })
}

//搜索比赛名称
export const getProjectNameList=(kw)=>{
    return request({
        url:'/project/getProjectNameList',
        method:'post',
        params:{kw}
    })
}

//组建团队
export const organizeTeamWithInfoAndMember=(organizeTeamRequest)=>{
    return request({
        url:'/team/organizeTeamWithInfoAndMember',
        method:'post',
        data: organizeTeamRequest
    })
}
